from google.appengine.api import users

def loginRequired(func):
	def wrapper(self, *args, **kw):
		user = users.get_current_user()
		if not user:
			self.redirect(users.create_login_url(self.request.uri))
		else:
			func(self, *args, **kw)
	return wrapper
